#include <func.h>

void *function(void*p)
{
    printf("i am thread %ld\n",(long)p);
    pthread_exit((void*)2);
}

int main()
{
    pthread_t pth;
    long i=1;
    int ret=pthread_create(&pth,NULL,function,(void*)i);
    THREAD_ERR_CHECK(ret,"pthread_create");
    long ret_thread;
    ret=pthread_join(pth,(void**)&ret_thread);
    THREAD_ERR_CHECK(ret,"pthread_join");
    printf("i get %ld\n",ret_thread);
}